#include "tcp_client.hpp"

void usage(const std::string& proc)
{
    std::cout << "Usage:\n\t" << proc << " server_ip server_port\n" << std::endl;
}

int main(int argc, char* argv[])
{
#if defined (__linux__) || defined (__APPLE__)
    if (argc != 3)
    {
        usage(argv[0]);
        exit(CMD_ERR);
    }

    std::string sip = argv[1];
    uint16_t sport = std::stoi(argv[2]);
#elif defined (WIN32) || defined (WIN64)
    std::string sip = "1.94.40.125";
    uint16_t sport = 8080;
#endif

    std::unique_ptr<tcp::tcp_client> tcli(new tcp::tcp_client(sip, sport));
    tcli->init_server();
    tcli->start();

    return 0;
}
